#!/usr/bin/python
# -*- coding: utf-8 -*-

import math
import matplotlib.pyplot as plt
import numpy
import time
import requests
import json
import urllib


url="https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token=984644801"
url="https://mp.weixin.qq.com/cgi-bin/user_tag?action=get_all_data&lang=zh_CN&token=984644801"
cookies={}

sss = [
{
    "domain": ".qq.com",
    "expirationDate": 2147385600,
    "hostOnly": False,
    "httpOnly": False,
    "name": "pgv_pvid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "2277587998",
    "id": 1
},
{
    "domain": ".qq.com",
    "expirationDate": 2147483643.170584,
    "hostOnly": False,
    "httpOnly": False,
    "name": "pt2gguin",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "o0524263074",
    "id": 2
},
{
    "domain": ".qq.com",
    "expirationDate": 2147483643.074597,
    "hostOnly": False,
    "httpOnly": False,
    "name": "ptcz",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "7d9f2dee5c0d5395c20c416c9b1644567393eb79c9cec6f6f191671507a002d3",
    "id": 3
},
{
    "domain": ".qq.com",
    "expirationDate": 2147483643.074513,
    "hostOnly": False,
    "httpOnly": False,
    "name": "RK",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "dWsf2ld+PL",
    "id": 4
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "bizuin",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "3267682476",
    "id": 5
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "cert",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "OCQdLyxpMpd8UxFI3PUyrLulxfYVckKh",
    "id": 6
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "data_bizuin",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "3264684757",
    "id": 7
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "data_ticket",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "FlHWxZ1S8xkGXeIg8EQub6rM7EXcbrnmkmKlVDKwM6F3rxvLwHksLAfosEpPOiUj",
    "id": 8
},
{
    "domain": "mp.weixin.qq.com",
    "expirationDate": 4294967295,
    "hostOnly": True,
    "httpOnly": False,
    "name": "mm_lang",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": False,
    "storeId": "0",
    "value": "zh_CN",
    "id": 9
},
{
    "domain": "mp.weixin.qq.com",
    "expirationDate": 1515302604,
    "hostOnly": True,
    "httpOnly": False,
    "name": "noticeLoginFlag",
    "path": "/cgi-bin",
    "sameSite": "no_restriction",
    "secure": False,
    "session": False,
    "storeId": "0",
    "value": "1",
    "id": 10
},
{
    "domain": "mp.weixin.qq.com",
    "expirationDate": 1515302638,
    "hostOnly": True,
    "httpOnly": True,
    "name": "openid2ticket_o1SKXwhZ7LOT_fWjbnEqJhPMV8Mo",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": False,
    "storeId": "0",
    "value": "nq4FT/MjKccjQhRPVUZfWNq7lJddtw9YPN4bym938sE=",
    "id": 11
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "slave_sid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "WXVQZGpwYkQ4S2dTSVR2TGQ2MzhCVk5KSExaSVJ4SjZlRzM1YmhsUFpzTmxNMTZMU2ExenhxazBodks1YWw0aUNtYzU3ZU5CQ29nSUhMYjRVTW83d1pYZzFjQmlrM3piTm4xQVFQWXB5TnB0VWdrcEl5NGtoYzBORXZ0VnVLZWhBMmRnQWZVRkxDNjl2MkY0",
    "id": 12
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "slave_user",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "gh_84a8b3e00650",
    "id": 13
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "ticket",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "ffce2a0beec8fe681c9dc2571cc848bed7271c6b",
    "id": 14
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "ticket_id",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "gh_84a8b3e00650",
    "id": 15
},
{
    "domain": "mp.weixin.qq.com",
    "expirationDate": 2147483647,
    "hostOnly": True,
    "httpOnly": True,
    "name": "ua_id",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": False,
    "storeId": "0",
    "value": "BsgTanEzZlhKRhT6AAAAAJbVVIe07sKp7CviDQeHGEc=",
    "id": 16
},
{
    "domain": "mp.weixin.qq.com",
    "hostOnly": True,
    "httpOnly": True,
    "name": "uuid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": True,
    "storeId": "0",
    "value": "2b6dbfb079540bfd11efa7c8c05c5bb8",
    "id": 17
},
{
    "domain": "mp.weixin.qq.com",
    "expirationDate": 2147483647,
    "hostOnly": True,
    "httpOnly": True,
    "name": "xid",
    "path": "/",
    "sameSite": "no_restriction",
    "secure": True,
    "session": False,
    "storeId": "0",
    "value": "bd9be33f6574f72098ae57dd9a261dfe",
    "id": 18
}
]

for val in sss:
    cookies[ val["name"] ] = val["value"]

url="https://lu.taobao.com/api/view_count?id=558636407083&_ksTS=1412581003175_109&f=jp&callback=j"
r = requests.get(url=url)

print(r.text)

